﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlBaoCaoTienDoThucHienChiTieu.ascx.cs" Inherits="UserControl_ControlBaoCaoTienDoThucHienChiTieu" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dxwpg" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraPivotGrid.Web" tagprefix="dxpgw" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>


<script type="text/javascript">
    function pageLoad() {

        $("#<%= imgBtnAdd.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });
        $("#<%= imgBtnSave.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });
        $("#<%= imgBtnPivot.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });
        $("#<%= imgBtnClearFilter.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }

    }

</script>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="imgBtnSave" />
<asp:PostBackTrigger ControlID="imgBtnPivot" />
</Triggers>
    <ContentTemplate>
    
                <div class="direct_container_right_titletop direct_colleft">
                    Báo cáo tiến độ thực hiện chỉ tiêu
                </div>
                
                <!-- Button chuc nang-->
                <div class="direct_menu_report_page direct_colleft">
                
                    Chọn năm:
                  
                    <asp:DropDownList ID="DropMonthy" runat="server" >
                    </asp:DropDownList>
                   
                    <asp:ImageButton ID="imgBtnAdd" CausesValidation="false" onclick="imgBtnAdd_Click" ToolTip="Lấy dữ liệu"  ImageUrl="~/Images/Document.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnSave" onclick="imgBtnSave_Click" CausesValidation="false" ToolTip="Xuất ra file excel dạng thường" ImageUrl="~/Images/download.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnPivot" onclick="imgBtnPivot_Click" CausesValidation="false" ToolTip="Xuất ra pivot excel" ImageUrl="~/Images/Thumbs_Up.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnClearFilter" runat="server" CausesValidation="false" 
                        Height="32px" ImageUrl="~/Images/Refresh.png" onclick="imgBtnClearFilter_Click" 
                        ToolTip="Reset lại dữ liệu" Width="32px" />
                </div>
                <!-- End Button chuc nang-->
                <div class="clear"></div>
                 <hr />

                
                   <table>
                   
                    <tr>
                    <td>
                      <dxpgw:ASPxPivotGridExporter ID="ASPxPivotGridExporter1" ASPxPivotGridID="ASPxPivotGrid1" runat="server" Width="100%">
        </dxpgw:ASPxPivotGridExporter>
        <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid1" CustomizationFieldsVisible="True"    OnCustomCellDisplayText="ASPxPivotGrid1_CustomCellDisplayText" runat="server">
                 <Fields>
                

                <dxwpg:PivotGridField ID="fieldReportTo"  AreaIndex="0" Caption="Báo cáo cho" FieldName="ReportTo" 
                         Area="RowArea" Visible="False">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="fieldNVBH"  AreaIndex="0" Caption="Nhân viên bán hàng" 
                         FieldName="NVBH" Area="RowArea">
                </dxwpg:PivotGridField>

                <dxwpg:PivotGridField ID="fieldGAMHang"  AreaIndex="0" Caption="GAM" 
                         FieldName="GAMHang" Visible="False">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="fieldGroupHang"  AreaIndex="0" Caption="Group" 
                         FieldName="GroupHang" Visible="False">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="fieldMatHang" Area="RowArea"  AreaIndex="1" 
                         Caption="Mặt hàng" FieldName="MatHang">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="fieldQuarter" Area="ColumnArea"  AreaIndex="0" 
                         Caption="Quý" FieldName="Quarter" GrandTotalText="Tổng">
                </dxwpg:PivotGridField>
                
                        
                     <dxwpg:PivotGridField ID="fieldSalesQty" Caption="Số lượng thực đạt"  Area="DataArea" 
                         AreaIndex="2" CellFormat-FormatString="{0:#,###}" 
                         CellFormat-FormatType="Numeric" FieldName="SalesQty">
                     </dxwpg:PivotGridField>
                
                        
                     <dxwpg:PivotGridField ID="fieldSalesAmt" Area="DataArea" AreaIndex="3" 
                         Caption="Doanh số thực đạt" CellFormat-FormatString="{0:#,###.##}" 
                         CellFormat-FormatType="Numeric" FieldName="SalesAmt">
                     </dxwpg:PivotGridField>
                     <dxwpg:PivotGridField ID="fieldTarget" Area="DataArea" AreaIndex="0" 
                         Caption="Chỉ tiêu" CellFormat-FormatString="{0:#,###}" 
                         CellFormat-FormatType="Numeric" FieldName="Target">
                     </dxwpg:PivotGridField>
                     <dxwpg:PivotGridField ID="fieldTargetAmt" Area="DataArea" AreaIndex="1" 
                         Caption="Quy ra tiền" CellFormat-FormatString="{0:#,###.##}" 
                         CellFormat-FormatType="Numeric" FieldName="TargetAmt">
                     </dxwpg:PivotGridField>
                     <dxwpg:PivotGridField ID="fieldProgess" Area="DataArea" AreaIndex="4" 
                         Caption="%Đạt" CellFormat-FormatString="{#,###.##}" 
                         CellFormat-FormatType="Numeric">
                     </dxwpg:PivotGridField>
                
                        
                </Fields>
                 <OptionsView ShowColumnHeaders="False" ShowDataHeaders="False" />
                <OptionsPager Visible="False">
               </OptionsPager>
        </dxwpg:ASPxPivotGrid>
                    </td>
                    </tr>
                 </table>
                              
            <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>  
    </ContentTemplate>
</asp:UpdatePanel>